Skip to content

Add mention decorator for GitHub command handling #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 29 commits into
base: main
Choose a base branch
from

Conversation

joshuadavidthomas
Copy link
Owner

No description provided.

joshuadavidthomas and others added 22 commits June 19, 2025 18:07
Updates the kwarg passed to mention handlers from "mention" to "context"
to better reflect that it contains a MentionContext object with comment,
triggered_by, and scope fields. Also removes unused _mention_permission
attribute from MentionHandlerBase protocol.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Moves the get_event_scope function to be a classmethod on MentionScope
called from_event, following the same pattern as Comment.from_event.
This provides a more consistent API and better encapsulation.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add explicit kwargs to mention() decorator (pattern, username, scope)
- Pass context as explicit parameter instead of mutating kwargs
- Create MentionEvent.from_event() generator to encapsulate all mention
  processing logic (parsing, filtering, context creation)
- Rename MentionContext to MentionEvent for clarity
- Simplify router code from ~30 lines to 4 lines per wrapper

This creates a much cleaner API where the mention decorator's wrappers
simply iterate over MentionEvent instances yielded by the generator.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant